import Vue from 'vue'
import Element, { Loading } from 'element-ui'
import './element-variables.scss'

Vue.prototype.$startLoading = function(text = '') {
  Vue.prototype.$customLoading = Loading.service({
    lock: true,
    text: text,
    body: false,
    spinner: 'el-icon-loading',
    customClass: 'custom-loading',
    background: 'rgba(0, 0, 0, 0.5)'
  })
}
Vue.prototype.$endLoading = function() {
  Vue.prototype.$customLoading && Vue.prototype.$customLoading.close()
}
Element.Input.props.clearable.default = true
Element.Select.props.clearable.default = true
Element.DatePicker.mixins[0].props.clearable.default = true
Vue.use(Element, { size: 'mini' })
